//
//  ConcernAndFunsOtherVC.m
//  ioschishan
//
//  Created by 马田成 on 2017/7/18.
//  Copyright © 2017年 qianyi. All rights reserved.
//

#import "ConcernAndFunsOtherVC.h"
#import "ConcernAndFunsTableViewCell.h"
#import "HomeCrowdfundingViewController.h"
#import "SearchFunsViewController.h"
@interface ConcernAndFunsOtherVC ()<UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *dataArr;

@end

@implementation ConcernAndFunsOtherVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self creationView];
    [self regeditCell];
    
    // Do any additional setup after loading the view.
}
- (void)creationView{
    
    UISearchBar *search = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, DEF_SCREEN_WIDTH, 40)];
    [self.view addSubview:search];
    search.placeholder = @"搜索";
    search.backgroundColor = [UIColor lightGrayColor];
    search.delegate = self;
    
    self.tableView = [[UITableView alloc] init];
    self.tableView.frame = CGRectMake(0, 40, DEF_SCREEN_WIDTH, DEF_SCREEN_HEIGHT - 64 - 40 - 49 - 40);
    
    
    self.tableView.tableFooterView = [[UITableView alloc] initWithFrame:CGRectZero];
    
    self.tableView.backgroundColor = [UIColor whiteColor];
    
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    //   self.tableView.estimatedRowHeight = 400;
    //   self.tableView.separatorStyle = UITableViewCellAccessoryNone;去掉分割线
    
    
    [self.view addSubview:self.tableView];
    
    
}
- (void)regeditCell{
    
    
    
    [self.tableView registerNib:[UINib nibWithNibName:@"ConcernAndFunsTableViewCell" bundle:nil] forCellReuseIdentifier:@"ConcernAndFunsTableViewCell"];
    
}
#pragma mark - ---------- Section的数量 ----------
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

#pragma mark - ---------- 每个Section的高度 ----------
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0;
}

#pragma mark - ---------- Cell的数量 ----------
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 5;
    
    
}

#pragma mark - ---------- 每个Cell的高度 ----------
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    
    return screenScale(70);
    
}
#pragma mark - ---------- 每个Cell的内容 ----------
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    ConcernAndFunsTableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"ConcernAndFunsTableViewCell" forIndexPath:indexPath];
    
    cell.selectionStyle=UITableViewCellSelectionStyleNone;
    
    

    return cell;
    
}
#pragma mark - ---------- 每个Cell的点击事件 ----------
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    

    
    
}
//已经开始编辑时的回调
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar{

    SearchFunsViewController *vc = [[SearchFunsViewController alloc] init];
    
    vc.hidesBottomBarWhenPushed = YES;
    
    [self.navigationController presentViewController:vc animated:YES completion:nil];
    


}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
